<template>
  <div
    class="jy-style-height message-box"
    :class="{
      ' Cultural-box-loop': !route.meta.loopType,
    }"
    :style="{
      'background-image': `url(${publicUrls + 'free/style15/copyrightBg1.png' + '?imageView2/3/format/webp'})`,
    }"
  >
    <div class="copyright-heard">
      <div class="heard-blank">
        <i class="freeIcon" @click="blankHome">&#xe642;</i>
      </div>
      <div class="heard-title">
        <span>留言板</span>
      </div>
    </div>
    <div
      class="message-content"
      :style="{
        'background-image': `url(${publicUrls + 'free/style15/copyrightBg2.png' + '?imageView2/3/format/webp'})`,
      }"
    >
      <div class="comment-box">
        <comment />
      </div>
      <div class="commentList-box">
        <div class="commentNum">共{{ total }}条留言</div>
        <div class="commentList-box-content">
          <ScrollBox
            color="rgba(50, 43, 37, 1)"
            :scrollSrc="publicUrls + 'free/style15/pen.png'"
            v-if="scrollheight"
            :byid="42325"
            :width="getScrollHeight"
          >
            <template #solidBorderCon>
              <commentList @emitTotal="emitTotal" />
            </template>
            <template #solidBorderEx>
              <div class="solidBorder-child"></div>
            </template>
          </ScrollBox>
        </div>
      </div>
    </div>
  </div>
  <!-- <a 
      :href="doorUrl"
      target="blank"
      class="logo-box"
      :style="{
        'background-image': `url(${publicUrls + 'free/style15/template5Logobg.png' + '?imageView2/3/format/webp'})`,
      }"
    ></a> -->
  <MenuNavigation />
</template> 

<script lang="ts">
// @ts-nocheck
export default defineComponent({
  name: 'style1',
});
</script>

<script setup lang="ts">
// @ts-nocheck
import MenuNavigation from '@/freeComponents/menuNavigation/index.vue';
import { defineComponent, ref, computed } from 'vue';
import comment from '../messageComponent/style15/comment.vue';
import commentList from '../messageComponent/style15/commentList.vue';
import { publicUrls, doorUrl } from '@/utils/minxin';
import { commonDataStore } from '@/store';
const commonStore = commonDataStore();
import { useRouter, useRoute } from 'vue-router';
import ScrollBox from '../scrollBox.vue';
const router = useRouter();
const route = useRoute();
const total = ref(0);
const scrollheight = ref();

let viewportHeight = window.innerHeight;
scrollheight.value = viewportHeight * 0.37;
const getScrollHeight = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 356;
  return heights;
});

const blankHome = () => {
  router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
};
const emitTotal = (num: number) => {
  total.value = num;
};
</script>

<style scoped lang="less">
.message-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 40px 60px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.Cultural-box-loop {
  padding-top: 20px;
}
.logo-box {
  width: 287px;
  height: 26px;
  position: absolute;
  bottom: 20px;
  left: calc(50% - 143.5px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.copyright-heard {
  position: relative;
  display: flex;
  // align-items: center;
  justify-content: center;
  width: 1320px;
  height: 66px;
  margin-bottom: 14px;

  .heard-title {
    display: flex;
    align-items: center;
    height: 56px;
    span {
      font-family: SourceHanSerifCN-Bold;
      font-size: 36px;
      line-height: 56px;
      text-align: center;
      color: rgba(2, 76, 63, 1);
    }
  }
  .heard-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #c3b7a3;
    box-shadow: 0.5px 0.5px 3px 0px rgba(0, 0, 0, 0.15) inset;
    .freeIcon {
      cursor: pointer;

      font-size: 36px;
      line-height: 36px;
      color: rgba(250, 238, 220, 1);
    }
  }
}

.message-content {
  display: flex;
  flex-direction: column;
  width: 1320px;
  height: 740px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 80px 110px;
  box-shadow: 0px 6px 10px 0px rgba(0, 0, 0, 0.1);
}
.comment-box {
  width: 100%;

  margin-bottom: 24.63px;
}
.commentList-box {
  display: flex;
  flex-direction: column;

  //   flex: 1;
  height: 400px;
  width: 100%;
}

.commentNum {
  width: 100%;
  height: 25px;
  font-family: PingFang SC;
  font-weight: 400;
  font-size: 18px;
  color: rgba(51, 51, 51, 1);
  line-height: 25px;
  text-align: left;
  margin-bottom: 35px;
}
.commentList-box-content {
  width: 100%;
  height: calc(100% - 24px);
  // overflow: auto;
}
.solidBorder-child {
  width: 2px;
  height: 100%;
  background: #c3b7a3;
  border-radius: 1px;
  opacity: 0.6;
}
:deep(.templatestyle1-scroll-box-tumb) {
  display: flex;
  justify-content: center;
  img {
    width: 24px;
    height: 24px;
  }
}
.commentList-box-content::-webkit-scrollbar {
  display: none;
}
.footer-logo-box {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 276px;
  height: 24px;
}
:deep(.solid-box-parent) {
  position: absolute;
  right: -35px;
}
:deep(.unit-exbi-remarks-info-remarks) {
  width: 100% !important;
}
</style>